package br.com.wepa.webapps.security;

import java.io.Serializable;

public class Role implements Serializable, Comparable<Role>{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5108545915858000757L;
	private String role;

	public Role(String role){		
		this.role = role;
	}
	

	public int compareTo(Role o) {
		if(this.role == null){
			return 0;
		}
		return this.role.compareTo(o.role);
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Role) {
			Role r = (Role) obj;
			if(this.role == null){
				return this.role == r.role;
			}else{
				return this.role.equals(r.role);		
			}
		}
		return false;
	}
	
	@Override
	public int hashCode() {		
		return role.hashCode();
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}
	
	@Override
	public String toString() {		
	 return  " role=" +  role ;			 
	}
}
